package com.bwie.controller;


import com.bwie.pojo.TbActive;
import com.bwie.service.TbActiveService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description : TODO
 * @Author QiHainan
 * @Create 2025/7/29 9:29
 * @Version 1.0
 */
@RestController
@RequestMapping("/win/index")
public class IndexController {
    @Autowired
    TbActiveService tbActiveService;

    /**
     * 获取抽奖分页列表
     * @param pageInfoVo
     * @return
     */
    @PostMapping("/getActiveList")
    public R getActiveList(@RequestBody PageInfoVo pageInfoVo){
        return tbActiveService.getActiveList(pageInfoVo);
    }

    /**
     * 添加抽奖活动
     * @param tbActive
     * @return
     */
    @PostMapping("/addActive")
    public R addActive(@RequestBody TbActive tbActive){
        return tbActiveService.addActive(tbActive);
    }

    /**
     * 删除活动
     * @param activeId
     * @return
     */
    @PostMapping("/deleteActive/{activeId}")
    public R deleteActive(@PathVariable("activeId") Integer activeId){
        return tbActiveService.deleteActive(activeId);
    }

    /**
     * 修改活动信息
     * @param tbActive
     * @return
     */
    @PostMapping("/updateActive")
    public R updateActive(@RequestBody TbActive tbActive){
        return tbActiveService.updateActive(tbActive);
    }

    /**
     * 查询规则列表数据
     * @param activeId
     * @return
     */
    @PostMapping("/getActiveRuleList/{activeId}")
    public R getActiveRuleList(@PathVariable("activeId") Integer activeId){
        return tbActiveService.getActiveRuleList(activeId);
    }
}
